<?php

/**
 * home actions.
 *
 * @package    docplus.co.za
 * @subpackage home
 * @author     Fox Matuku
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class homeActions extends sfActions
{

    public function preExecute()
    {
        $this->getUser()->setCurrentRoute("home");
        parent::preExecute();
    }

    /**
     * Executes index action
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request)
    {
        // fetch active doctors
        $this->doctors = DoctorTable::getInstance()->retrieveForCorusel();
        
        $user = $this->getUser()->getDpUser();
        $this->form = new myDoctorSearchForm();
        $this->question = new Question();
        if ($this->getUser()->isAuthenticated())
        {
            $this->question->setUserId($this->getUser()->getDpUser()->getId());
        }

        $this->questionForm = new QuestionForm($this->question);
    }

}
